package com.ruoyi.business.service.impl;

import java.util.List;

import com.ruoyi.business.domain.vo.BusHiddenRiskVo;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.BusHiddenRiskMapper;
import com.ruoyi.business.domain.BusHiddenRisk;
import com.ruoyi.business.service.IBusHiddenRiskService;
import javax.annotation.Resource;

/**
 * 待处理隐患台账Service业务层处理
 * 
 * @author ling
 * @date 2024-07-24
 */
@Service
public class BusHiddenRiskServiceImpl implements IBusHiddenRiskService 
{
    @Resource
    private BusHiddenRiskMapper busHiddenRiskMapper;

    /**
     * 查询待处理隐患台账
     * 
     * @param id 待处理隐患台账主键
     * @return 待处理隐患台账
     */
    @Override
    public BusHiddenRisk selectBusHiddenRiskById(Long id)
    {
        return busHiddenRiskMapper.selectBusHiddenRiskById(id);
    }

    /**
     * 查询待处理隐患台账列表
     * 
     * @param busHiddenRisk 待处理隐患台账
     * @return 待处理隐患台账
     */
    @Override
    public List<BusHiddenRisk> selectBusHiddenRiskList(BusHiddenRisk busHiddenRisk)
    {
        return busHiddenRiskMapper.selectBusHiddenRiskList(busHiddenRisk);
    }

    /**
     * 新增待处理隐患台账
     * 
     * @param busHiddenRisk 待处理隐患台账
     * @return 结果
     */
    @Override
    public int insertBusHiddenRisk(BusHiddenRisk busHiddenRisk)
    {
        busHiddenRisk.setCreateUser(SecurityUtils.getUserId());
        busHiddenRisk.setCreateBy(SecurityUtils.getUsername());
        busHiddenRisk.setCreateTime(DateUtils.getNowDate());
        busHiddenRisk.setUpdateUser(SecurityUtils.getUserId());
        busHiddenRisk.setUpdateBy(SecurityUtils.getUsername());
        busHiddenRisk.setUpdateTime(DateUtils.getNowDate());
        return busHiddenRiskMapper.insertBusHiddenRisk(busHiddenRisk);
    }

    /**
     * 修改待处理隐患台账
     * 
     * @param busHiddenRisk 待处理隐患台账
     * @return 结果
     */
    @Override
    public int updateBusHiddenRisk(BusHiddenRisk busHiddenRisk)
    {
        busHiddenRisk.setUpdateUser(SecurityUtils.getUserId());
        busHiddenRisk.setUpdateBy(SecurityUtils.getUsername());
        busHiddenRisk.setUpdateTime(DateUtils.getNowDate());
        return busHiddenRiskMapper.updateBusHiddenRisk(busHiddenRisk);
    }

    /**
     * 批量删除待处理隐患台账
     * 
     * @param ids 需要删除的待处理隐患台账主键
     * @return 结果
     */
    @Override
    public int deleteBusHiddenRiskByIds(Long[] ids)
    {
        return busHiddenRiskMapper.deleteBusHiddenRiskByIds(ids);
    }

    /**
     * 删除待处理隐患台账信息
     * 
     * @param id 待处理隐患台账主键
     * @return 结果
     */
    @Override
    public int deleteBusHiddenRiskById(Long id)
    {
        return busHiddenRiskMapper.deleteBusHiddenRiskById(id);
    }

    @Override
    public List<BusHiddenRiskVo> selectBusHiddenRiskVoList(BusHiddenRisk busHiddenRisk) {
        return busHiddenRiskMapper.selectBusHiddenRiskVoList(busHiddenRisk);
    }

    @Override
    public List<BusHiddenRiskVo> selectBusHiddenRiskVoConfirmList(BusHiddenRisk busHiddenRisk) {
        return busHiddenRiskMapper.selectBusHiddenRiskVoConfirmList(busHiddenRisk);
    }


}
